import { createApp } from 'vue'
import App from './App.vue'
import { registerEcharts } from './plugins/echarts'
import ElementPlus from 'element-plus'
import { zhCn } from 'element-plus/es/locales.mjs'
import 'dayjs/locale/zh-cn'  // 针对日期类的组件进行国际化
import { createPinia } from 'pinia'

import { registerRouter } from './router'
import { registerPinia } from './store';

import './styles/global.scss'

// 引入全部图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'

const app = createApp(App)
registerEcharts(app);
app.use(createPinia()); // 全局注册Pinia
app.use(ElementPlus, {
  locale: zhCn
})

// 全局注册路由对象
registerRouter(app);

// 全局注册状态机
registerPinia(app);


// 引入全部图标

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.mount('#app')
